package com.wuseguang.springcloud.dao.repository;

import com.wuseguang.springcloud.entity.StudentFaces;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface StudentFacesRepository  extends JpaRepository<StudentFaces,Integer> {

    @Query(value = "delete from student_faces where student_id = ?1",nativeQuery = true)
    int deleteByStudentId(Integer studentId);

    @Query(value = "select * from student_faces where student_id = ?1 and state !=4 and state !=3",nativeQuery = true)
    StudentFaces findByStudentId(Integer studentId);

    @Query(value = "select * from student_faces where student_id = ?1 and state =3 ",nativeQuery = true)
    StudentFaces findByError(Integer studentId);
}
